const methods = {
  // 方法1: 生成包含大小写字母和数字的随机字符串
  getRandomString(length: number) {
    const chars =
      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    let result = '';
    const charsLength = chars.length;

    for (let i = 0; i < length; i++) {
      // 生成0到charsLength-1之间的随机索引
      const randomIndex = Math.floor(Math.random() * charsLength);
      result += chars.charAt(randomIndex);
    }
    return result;
  },
};

export default methods;
